Executing tests with batch files
.tptbatch
file using the Batch Runner view.
To open the Batch Runner view in TPT, go to View|Show View|Batch Runner.
The Batch Runner view is used to create a batch file for executing several execution configurations in multiple TPT files or TPT API scripts sequentially in the background. Select View|Show View|Batch Runner to open the Batch Runner view.
The toolbar contains the following elements:
create a new batch configuration (Ctrl+N) | |
open a batch configuration (Ctrl+O) | |
save batch configuration (Ctrl+S), save batch configuration as (Ctrl+Alt+S) | |
submenu of ; export the batch configuration as Windows batch file; select this icon to generate a batch file using the currently displayed batch configuration (.bat ) |
|
add a new step, by default, Execute tests step is inserted (Insert) | |
remove the selected step (Del) | |
duplicate the selected step (Ctrl+B) | |
move the selected step up/ down (Ctrl+Up/Down) | |
start the batch execution of all steps; | |
start batch execution only of the enabled or disabled selected step | |
terminate the batch execution | |
show/hide the log panel | |
clear information about the batch process displayed in the Log panel |
The view offers 4 batch step types. You can select them from the drop-down list below the table. Each step has different settings. The file can either be exported as Windows batch file or saved as tptbatch
file.
The paths to referenced TPT files are by default saved as absolute paths in tptbatch
files. They are only saved as relative paths if the TPT files are located on the same partition.
[Enabled/disabled]
Batch steps can be disabled or enabled. To disable a steps, select them in the table and click Enabled; the icon changes to . To enable them, click the icon again.
Steps
This column lists the details of each batch step. The details are specified in the section below the table.
Status
This column shows the execution status during the batch execution for each batch step.
Execute Tests step
This step is necessary to execute test cases of a TPT project. You must select a TPT model and an execution configuration, see also Create execution configuration items.
TPT model
When you have saved the batch file as .tptbatch
, a relative file path is possible. The path to the file can be changed. The file itself can be replaced by another one without the need to replace the Execute Tests step.
To add a TPT file, click in the TPT model text field and then the three dots button "...".
Execution config
A TPT model file can contain several execution configurations. Select one from the drop-down list. The list is automatically updated when you add new execution configurations to your TPT model or when you remove execution configurations.
Additional arguments
Additional arguments can be added (optional). For an overview of the command line parameters that are important for the Execute Tests step, see Build plug-in.
Open Report
Test report for the batch step. Is only available after the step has been executed.
Execute API Script step
This step executes a TPTAPI script. The script can be created in the API Script Editor view, see API Script Editor view.
Execute script
Select a .tptapi
or .py
file that should be executed by TPT.
Additional arguments
The arguments are passed to the script and are accessible in the Python script via
import sys
script_file = sys.argv[0]
arg_1 = sys.argv[1]
See also Python bindings.
Generate Testframe step
This step is only supported when using the ASCET platform, ASCET@FUSION platform, AUTOSAR platform, C/C++ platform, or MATLAB/Simulink platform.
TPT model
The path to the file can be changed and a file can be replaced by another one. Click on a file and use the three dots button "..." in the column. The execution configuration of the new file is loaded automatically.
Platform
Select the platform for which the test frame should to be generated.
Batch Overview Report step
This step generates a report for all executed execution configurations placed before it. The report section for Execute Tests steps placed after the Batch Overview Report step will be empty.
Target folder
Specify the output folder. Leave this filed empty to use the directory of your TPTBATCH file.
Open Batch Overview Report
Is only available after the step has been executed.